jQuery(function($) {
	//	Add the class "hasJS" to the body element.
	$('body').addClass('hasJS');
	/*
	//	Automatically clear default text in input fields when they are focused
	$("input[type='text']").focus(function() {
		if ($(this).val() == this.defaultValue) {
			$(this).val('');
		}
	});
	//	Reinstate the default value if nothing has been entered.
	$("input[type='text']").blur(function() {
		if ($(this).val() == '') {
			$(this).val(this.defaultValue);
		}
	});

	//	Make the targets of internal links toggleable.
	$('a.toggle').each(function() {
		//	Get the id of the target of each internal link.
		var id = $(this).attr('href');
		if ($(id)) {
			//	Hide the targets by default.
			$(id).addClass('hidden');
			//	Add a button to hide the target.
			$(id).prepend('<button class="close"><img src="/images/icons/close.gif" alt="close" /></button>');
			$(id+' button').click(function() {
				$('.showing').removeClass('showing');
				$('.displaying').removeClass('displaying');
				$(id).toggle();
				$('#search select').removeClass('hidden');
			});
			$(this).click(function() {
				var id = $(this).attr('href');
				//	If a layer is already showing, hide it now.
				$('.showing').each(function() {
					var current_id = '#'+$(this).attr('id');
					if (id != current_id) {
						$(current_id).toggle();
						$('.showing').toggleClass('showing');
						//	Remove classes attached to internal links.
						$('.displaying').removeClass('displaying');
						$('#search select').removeClass('hidden');
					}
				});
				//	Toggle the display of the target.
				$(id).slideToggle('fast');
				$(id).toggleClass('showing');
				//	Add a class to the link that was clicked.
				$(this).toggleClass('displaying');
				$(this).parent().toggleClass('displaying');
				
				//	Horrible, horrible hack for IE6 to hide the search select if content is overlaying.
				if ($.browser.msie && parseInt($.browser.version) < 7) {
					if ($(id).hasClass('showing')) {
						$('#search select').addClass('hidden');
					} else {
						$('#search select').removeClass('hidden');
					}
				}
				return false;
			});
		}
	});

	//	toglleable items inside a toggled container
	$('a.toggle-inner').each(function() {
		//	Get the id of the target of each internal link.
		var id = $(this).attr('href');
		if ($(id)) {
			if (!($(id).hasClass('showing-inner'))){
				//	Hide the targets by default if it is not the initial thing
				$(id).addClass('hidden');
			}
			
			$(this).click(function() {
				var id = $(this).attr('href');
				//	If a layer is already showing, hide it now.
				$(this.parentNode.parentNode.parentNode).find('.showing-inner').each(function() {
					var current_id = '#'+$(this).attr('id');
					if (id != current_id) {
						$(current_id).toggle();
						$(this.parentNode.parentNode.parentNode).find('.showing-inner').removeClass('showing-inner');
						//	Remove classes attached to internal links.
						$(this.parentNode.parentNode.parentNode).find('.displaying-inner').removeClass('displaying-inner');
					}
				});
				//	Show the target.
				$(id).show();
				$(id).addClass('showing-inner');
				$(id).removeClass('hidden');
				//	Add a class to the link that was clicked.
				$(this).addClass('displaying-inner');
				$(this).parent().toggleClass('displaying-inner');
				return false;
			});
			
		}
	});
	//	Add a class of "odd" to every second row of tables with the class "striped".
	$('table.striped tr:nth-child(odd)').addClass('odd');
	
	$('.feedback').each(function() {
		$(this).prepend('<button><img src="/images/icons/close.gif" alt="close" /></button>');
	});
	$('.feedback button').click(function() {
		$(this).parent().slideUp('fast');
	});
    */
});
